Public Partial Class frmEnviaArquivo
    Inherits System.Web.UI.Page
    Protected script As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        If FileUpload1.HasFile Then
            FileUpload1.SaveAs(Server.MapPath("/Icli/uploads/" & FileUpload1.FileName))
            'C:\intepub\wwwroot\site\uploads\arquiv.rar


            Dim tipo As String = Request("Tipo")
            Dim retorno As String = Request("Retorno")
            Dim botao As String = Request("botao")
            If Trim(UCase(tipo)) = "IMAGE" Then
                Response.Write("<script language='javascript'>")
                Response.Write(" window.opener.document.getElementById('" & retorno & "').value='" & Request("path") & FileUpload1.FileName & "';")
                Response.Write(" window.opener.execScript(""__doPostBack('" & botao & "','')"");")
                Response.Write(" window.close();")
                Response.Write("</script>")
            End If


        End If



    End Sub
End Class